package com.xiaowanzi.transporter.handler.resolver;

import com.xiaowanzi.transporter.constants.MessageTypeEnum;
import com.xiaowanzi.transporter.model.Message;

public class PongMessageResolver implements Resolver {

  @Override
  public boolean support(Message message) {
    return message.getMessageType() == MessageTypeEnum.PONG;
  }

  @Override
  public Message resolve(Message message) {
    System.out.println("receive pong message: " + System.currentTimeMillis());
    Message empty = new Message();
    empty.setMessageType(MessageTypeEnum.EMPTY);
    return empty;
  }
}
